﻿@{
    ViewBag.Title = "Account Info - Project Management System";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Account Info</h2>
<form id="form" action="" method="post">
<div class="content-box" id="User">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Account Info
        </h3>
        <div class="clear">
        </div>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        @{ if (TempData["Message"] != null)
           {
            <div class="notification png_bg" id="messageBox">
                <a href="#" class="close">
                    <img src="../../Content/images/icons/cross_grey_small.png" title="Close this notification"
                        alt="close" /></a>
                <div>
                    @TempData["Message"].ToString()
                </div>
            </div>
           }
        }
        <fieldset>
            <input type="hidden" id="txtUserID" name="UserID"value="@Model.UserID"/>
            <p>
                <label class="width12 floatLeft">
                    Full Name:</label>
                <input type="text" id="txtFullName" name="FullName" class="width20 medium-input input-inline text-input" value="@Model.FullName"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    Birthday:</label>
                <input type="text" id="txtDateOfBirth"  class="DateTime width20 input-inline text-input" value="@Model.DateOfBirth.ToString("dd/MM/yyyy")"  />
                <input type="hidden" id="htxtDateOfBirth" name ="DateOfBirth" value="@Model.DateOfBirth.ToString("yyyy/MM/dd")"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    Sex:</label>
                <select id="Sex" name="Sex" class="width20 input-inline">
                    <option value=""></option>
                    <option value="Male">Male</option>
                    <option value="Female">Female</option>
                </select>
            </p>
            <p>
                <label class="width12 floatLeft">
                    Email:</label>
                <input type="text" id="txtEmail" name="Email" class="width20 input-inline text-input" value="@Model.Email"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    Department:</label>
                @Html.DropDownList("DepartmentID", (SelectList)ViewData["DepartmentList"], new { @class = "width20 input-inline" })
            </p>
            <p>
                <label class="width12 floatLeft">
                    Role:</label>
                @Html.DropDownList("RoleID", (SelectList)ViewData["RoleList"], new { @class = "width20 input-inline" })
            </p>
            <p>
                <label class="width12 floatLeft">
                    Username:</label>
                <input type="text" id="txtUsername" name="UserName" class="width20 input-inline text-input" value="@Model.UserName"/>
            </p>
            <p>
                <label class="width12 floatLeft">
                    Password:</label>
                <input type="password" id="txtPassword" name="Password" class="width20 input-inline text-input" value="@Model.Password"/>
            </p>
            <p>
                <input class="button" type="submit" value="Save" id="btnSubmit" />
            </p>
        </fieldset>
    </div>
</div>
</form>
<script type="text/javascript">
    $("#Setting").addClass("current");
    $("#ManageUser").addClass("current");

    var sex =   @Html.Raw(Json.Encode(Model.Sex));

    $("#Sex").val(sex);
    


    $(".DateTime").datepicker({
        dateFormat: 'dd/mm/yy',
        gotoCurrent: true,
        changeMonth: true,
        changeYear: true,
        showStatus: true,
        showWeeks: true,
        highlightWeek: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        hideIfNoPrevNext: true,
        showAnim: "scale",
        showOptions: {
            origin: ["top", "left"]
        }
    });

    $(".DateTime").filter_inputDateTime(DateTimeFormat);

    $("#txtEmail").change(function () {
        var emailaddress = $("#txtEmail").val();
        if (!isValidEmailAddress(emailaddress)) {
            jAlert("Invalid Email!", "Message");
            $("#txtEmail").val('');
        }
    });
</script>
